/*
 *  Copyright 2001-2004 The Apache Software Foundation
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package ar.uba.fi.posgrado.academy.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import ar.uba.fi.posgrado.common.model.AbstractDomainObject;
import ar.uba.fi.posgrado.economy.model.DebtType;

/**
 * Cuotas
 * 
 * @author ariel.piechotka
 * 
 */

@Entity
@Table(name = "CUOTA")
@SuppressWarnings("serial")
public class Instalment extends AbstractDomainObject {

	public static final short MAX_QTY_INSTALMENTS = 60;
	public static final short MAX_QTY_REG_FEES = 3;
	public static final short DEFAULT_QTY_INSTALMENTS = 12;
	public static final short DEFAULT_QTY_REG_FEES = 0;

	@Column(name = "NRO_CUOTA", nullable = false)
	private int instNumber;

	@Column(name = "VALOR_CUOTA", nullable = false)
	private double value;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_TIPO_CONCEPTO", nullable = false)
	private DebtType debtType;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ID_CURSO", nullable = false)
	private Course course;

	@Override
	public String[] getExcludedFields() {
		// TODO Auto-generated method stub
		return null;
	}

	public int getInstNumber() {
		return instNumber;
	}

	public void setInstNumber(int instNumber) {
		this.instNumber = instNumber;
	}

	public double getValue() {
		return value;
	}

	public void setValue(double valueQuota) {
		this.value = valueQuota;
	}

	public DebtType getDebtType() {
		return debtType;
	}

	public void setDebtType(DebtType debtType) {
		this.debtType = debtType;
	}

	public Course getCourse() {
		return course;
	}

	public void setCourse(Course course) {
		this.course = course;
	}
}
